package com.djl.springcloud.service;

import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

/**
 * @program: cloud
 * @description:
 * @author: Mr.dai
 * @create: 2021-09-23 15:59
 **/
@Service
public class PaymentService {
    /**
     * 正常访问的方法
     * @param id
     * @return
     */
    public String paymentInfo_Ok(Integer id){
        return "线程池："+Thread.currentThread().getName()+"paymentInfo_ok,id:"+id+"\t"+"O(∩_∩)O";
    }
    /**
     * 正常访问的方法
     * @param id
     * @return
     */
    public String paymentInfo_Timeout(Integer id){
        int time=3;
        try {
            TimeUnit.SECONDS.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "线程池："+Thread.currentThread().getName()+"paymentInfo_Timeout,id:"+id+"\t"+"O(∩_∩)O"+"耗时"+time+"秒钟";

    }
}
